using System;
using Microsoft.VisualBasic;
using Microsoft.VisualBasic.CompilerServices;

namespace AddMask;

[StandardModule]
public sealed class AddMask
{
	public enum MaskType
	{
		Ypbh,
		Type,
		Time,
		All
	}

	private static MaskType Mask;

	public static string NumtoMask(string Num)
	{
		int num = 0;
		checked
		{
			string result = default(string);
			switch (Num)
			{
			case "0":
			{
				num = DateTime.Now.Millisecond;
				VBMath.Randomize(num);
				int num2 = (int)Math.Round(VBMath.Rnd() * 7f);
				if (num2 == 0)
				{
					result = "156";
				}
				if (num2 == 1)
				{
					result = "389";
				}
				if (num2 == 2)
				{
					result = "583";
				}
				if (num2 == 3)
				{
					result = "759";
				}
				if (num2 == 4)
				{
					result = "081";
				}
				if (num2 == 5)
				{
					result = "871";
				}
				if (num2 == 6)
				{
					result = "493";
				}
				if (num2 == 7)
				{
					result = "615";
				}
				break;
			}
			case "1":
			{
				num = DateTime.Now.Millisecond;
				VBMath.Randomize(num);
				int num2 = (int)Math.Round(VBMath.Rnd() * 4f);
				if (num2 == 0)
				{
					result = "569";
				}
				if (num2 == 1)
				{
					result = "248";
				}
				if (num2 == 2)
				{
					result = "139";
				}
				if (num2 == 3)
				{
					result = "927";
				}
				if (num2 == 4)
				{
					result = "186";
				}
				break;
			}
			case "2":
			{
				num = DateTime.Now.Millisecond;
				VBMath.Randomize(num);
				int num2 = (int)Math.Round(VBMath.Rnd() * 4f);
				if (num2 == 0)
				{
					result = "941";
				}
				if (num2 == 1)
				{
					result = "206";
				}
				if (num2 == 2)
				{
					result = "112";
				}
				if (num2 == 3)
				{
					result = "349";
				}
				if (num2 == 4)
				{
					result = "624";
				}
				break;
			}
			case "3":
			{
				num = DateTime.Now.Millisecond;
				VBMath.Randomize(num);
				int num2 = (int)Math.Round(VBMath.Rnd() * 2f);
				if (num2 == 0)
				{
					result = "808";
				}
				if (num2 == 1)
				{
					result = "720";
				}
				if (num2 == 2)
				{
					result = "709";
				}
				break;
			}
			case "4":
			{
				num = DateTime.Now.Millisecond;
				VBMath.Randomize(num);
				int num2 = (int)Math.Round(VBMath.Rnd() * 2f);
				if (num2 == 0)
				{
					result = "454";
				}
				if (num2 == 1)
				{
					result = "753";
				}
				if (num2 == 2)
				{
					result = "683";
				}
				break;
			}
			case "5":
			{
				num = DateTime.Now.Millisecond;
				VBMath.Randomize(num);
				int num2 = (int)Math.Round(VBMath.Rnd() * 2f);
				if (num2 == 0)
				{
					result = "046";
				}
				if (num2 == 1)
				{
					result = "909";
				}
				if (num2 == 2)
				{
					result = "667";
				}
				break;
			}
			case "6":
			{
				num = DateTime.Now.Millisecond;
				VBMath.Randomize(num);
				int num2 = (int)Math.Round(VBMath.Rnd() * 2f);
				if (num2 == 0)
				{
					result = "336";
				}
				if (num2 == 1)
				{
					result = "915";
				}
				if (num2 == 2)
				{
					result = "479";
				}
				break;
			}
			case "7":
			{
				num = DateTime.Now.Millisecond;
				VBMath.Randomize(num);
				int num2 = (int)Math.Round(VBMath.Rnd() * 2f);
				if (num2 == 0)
				{
					result = "520";
				}
				if (num2 == 1)
				{
					result = "038";
				}
				if (num2 == 2)
				{
					result = "864";
				}
				break;
			}
			case "8":
			{
				num = DateTime.Now.Millisecond;
				VBMath.Randomize(num);
				int num2 = (int)Math.Round(VBMath.Rnd() * 2f);
				if (num2 == 0)
				{
					result = "899";
				}
				if (num2 == 1)
				{
					result = "255";
				}
				if (num2 == 2)
				{
					result = "551";
				}
				break;
			}
			case "9":
			{
				num = DateTime.Now.Millisecond;
				VBMath.Randomize(num);
				int num2 = (int)Math.Round(VBMath.Rnd() * 2f);
				if (num2 == 0)
				{
					result = "063";
				}
				if (num2 == 1)
				{
					result = "357";
				}
				if (num2 == 2)
				{
					result = "657";
				}
				break;
			}
			}
			return result;
		}
	}

	public static string MaskToNum(string Chr)
	{
		switch (Chr)
		{
		case "156":
		case "389":
		case "583":
		case "759":
		case "081":
		case "871":
		case "493":
		case "615":
			if (true)
			{
				return "0";
			}
			break;
		}
		switch (Chr)
		{
		case "569":
		case "248":
		case "139":
		case "927":
		case "186":
			if (true)
			{
				return "1";
			}
			break;
		}
		switch (Chr)
		{
		case "941":
		case "206":
		case "112":
		case "349":
		case "624":
			if (true)
			{
				return "2";
			}
			break;
		}
		switch (Chr)
		{
		case "808":
		case "720":
		case "709":
			if (true)
			{
				return "3";
			}
			break;
		}
		switch (Chr)
		{
		case "454":
		case "753":
		case "683":
			if (true)
			{
				return "4";
			}
			break;
		}
		switch (Chr)
		{
		case "046":
		case "909":
		case "667":
			if (true)
			{
				return "5";
			}
			break;
		}
		switch (Chr)
		{
		case "336":
		case "915":
		case "479":
			if (true)
			{
				return "6";
			}
			break;
		}
		switch (Chr)
		{
		case "520":
		case "038":
		case "864":
			if (true)
			{
				return "7";
			}
			break;
		}
		switch (Chr)
		{
		case "899":
		case "255":
		case "551":
			if (true)
			{
				return "8";
			}
			break;
		}
		switch (Chr)
		{
		case "063":
		case "357":
		case "657":
			if (true)
			{
				return "9";
			}
			break;
		}
		string result = default(string);
		return result;
	}

	public static string MoreStr(string Mask)
	{
		int millisecond = DateTime.Now.Millisecond;
		string text = default(string);
		if (millisecond >= 0 && millisecond <= 100)
		{
			text = "0";
		}
		if (millisecond > 100 && millisecond <= 200)
		{
			text = "1";
		}
		if (millisecond > 200 && millisecond <= 300)
		{
			text = "2";
		}
		if (millisecond > 300 && millisecond <= 400)
		{
			text = "3";
		}
		if (millisecond > 400 && millisecond <= 500)
		{
			text = "4";
		}
		if (millisecond > 500 && millisecond <= 600)
		{
			text = "5";
		}
		if (millisecond > 600 && millisecond <= 700)
		{
			text = "6";
		}
		if (millisecond > 700 && millisecond <= 800)
		{
			text = "7";
		}
		if (millisecond > 800 && millisecond <= 900)
		{
			text = "8";
		}
		if (millisecond > 900 && millisecond <= 999)
		{
			text = "9";
		}
		string text2 = default(string);
		switch (text)
		{
		case "0":
			millisecond = DateTime.Now.Millisecond;
			if (millisecond >= 0 && millisecond <= 300)
			{
				text2 = "";
			}
			if (millisecond > 300 && millisecond <= 600)
			{
				text2 = "";
			}
			if (millisecond > 500 && millisecond <= 999)
			{
				text2 = "";
			}
			break;
		case "1":
			millisecond = DateTime.Now.Millisecond;
			if (millisecond >= 0 && millisecond <= 300)
			{
				text2 = "1";
			}
			if (millisecond > 300 && millisecond <= 600)
			{
				text2 = "9";
			}
			if (millisecond > 500 && millisecond <= 999)
			{
				text2 = "3";
			}
			break;
		case "2":
			millisecond = DateTime.Now.Millisecond;
			if (millisecond >= 0 && millisecond <= 300)
			{
				text2 = "64";
			}
			if (millisecond > 300 && millisecond <= 600)
			{
				text2 = "89";
			}
			if (millisecond > 500 && millisecond <= 999)
			{
				text2 = "07";
			}
			break;
		case "3":
			millisecond = DateTime.Now.Millisecond;
			if (millisecond >= 0 && millisecond <= 300)
			{
				text2 = "928";
			}
			if (millisecond > 300 && millisecond <= 600)
			{
				text2 = "012";
			}
			if (millisecond > 500 && millisecond <= 999)
			{
				text2 = "975";
			}
			break;
		case "4":
			millisecond = DateTime.Now.Millisecond;
			if (millisecond >= 0 && millisecond <= 300)
			{
				text2 = "5243";
			}
			if (millisecond > 300 && millisecond <= 600)
			{
				text2 = "8712";
			}
			if (millisecond > 500 && millisecond <= 999)
			{
				text2 = "3654";
			}
			break;
		case "5":
			millisecond = DateTime.Now.Millisecond;
			if (millisecond >= 0 && millisecond <= 300)
			{
				text2 = "14283";
			}
			if (millisecond > 300 && millisecond <= 600)
			{
				text2 = "23132";
			}
			if (millisecond > 500 && millisecond <= 999)
			{
				text2 = "74691";
			}
			break;
		case "6":
			millisecond = DateTime.Now.Millisecond;
			if (millisecond >= 0 && millisecond <= 300)
			{
				text2 = "792021";
			}
			if (millisecond > 300 && millisecond <= 600)
			{
				text2 = "834722";
			}
			if (millisecond > 500 && millisecond <= 999)
			{
				text2 = "139204";
			}
			break;
		case "7":
			millisecond = DateTime.Now.Millisecond;
			if (millisecond >= 0 && millisecond <= 300)
			{
				text2 = "6480282";
			}
			if (millisecond > 300 && millisecond <= 600)
			{
				text2 = "0932891";
			}
			if (millisecond > 500 && millisecond <= 999)
			{
				text2 = "1928395";
			}
			break;
		case "8":
			millisecond = DateTime.Now.Millisecond;
			if (millisecond >= 0 && millisecond <= 300)
			{
				text2 = "34729020";
			}
			if (millisecond > 300 && millisecond <= 600)
			{
				text2 = "67389291";
			}
			if (millisecond > 500 && millisecond <= 999)
			{
				text2 = "89274912";
			}
			break;
		case "9":
			millisecond = DateTime.Now.Millisecond;
			if (millisecond >= 0 && millisecond <= 300)
			{
				text2 = "908231234";
			}
			if (millisecond > 300 && millisecond <= 600)
			{
				text2 = "526710283";
			}
			if (millisecond > 500 && millisecond <= 999)
			{
				text2 = "124562174";
			}
			break;
		}
		return NumtoMask(text) + text2 + Mask;
	}

	public static string SetMask(string NeedMaskStr)
	{
		int num = Strings.Len(NeedMaskStr);
		int num2 = 1;
		checked
		{
			string text = default(string);
			while (true)
			{
				int num3 = num2;
				int num4 = num;
				if (num3 > num4)
				{
					break;
				}
				string num5 = Strings.Left(NeedMaskStr, 1);
				NeedMaskStr = Strings.Right(NeedMaskStr, Strings.Len(NeedMaskStr) - 1);
				text += NumtoMask(num5);
				num2++;
			}
			string text2 = MoreStr(text);
			return text2.Length + text2;
		}
	}

	public static string GetMaskData(string MaskStr)
	{
		MaskStr = MaskStr.Substring(2, Convert.ToInt32(MaskStr.Substring(0, 2)));
		string chr = Strings.Left(MaskStr, 3);
		checked
		{
			MaskStr = Strings.Right(MaskStr, Strings.Len(MaskStr) - 3);
			int num = Convert.ToInt32(MaskToNum(chr));
			MaskStr = Strings.Right(MaskStr, Strings.Len(MaskStr) - num);
			int num2 = (int)Math.Round((double)Strings.Len(MaskStr) / 3.0);
			int num3 = 1;
			string text = default(string);
			while (true)
			{
				int num4 = num3;
				int num5 = num2;
				if (num4 > num5)
				{
					break;
				}
				chr = Strings.Left(MaskStr, 3);
				MaskStr = Strings.Right(MaskStr, Strings.Len(MaskStr) - 3);
				text += MaskToNum(chr);
				num3++;
			}
			return text;
		}
	}

	public static string ChangeChr(string Chr)
	{
		int num = 0;
		string result = default(string);
		switch (Chr)
		{
		case "0":
			num = DateTime.Now.Millisecond;
			if (num >= 0 && num <= 300)
			{
				result = "@#$";
			}
			if (num > 300 && num <= 600)
			{
				result = "#$@";
			}
			if (num > 500 && num <= 999)
			{
				result = "$#@";
			}
			break;
		case "1":
			num = DateTime.Now.Millisecond;
			if (num >= 0 && num <= 300)
			{
				result = "%^&";
			}
			if (num > 300 && num <= 600)
			{
				result = "^%&";
			}
			if (num > 600 && num <= 999)
			{
				result = "&%^";
			}
			break;
		case "2":
			num = DateTime.Now.Millisecond;
			if (num >= 0 && num <= 300)
			{
				result = "*!@";
			}
			if (num > 300 && num <= 600)
			{
				result = "@!*";
			}
			if (num > 500 && num <= 999)
			{
				result = "!*@";
			}
			break;
		case "3":
			num = DateTime.Now.Millisecond;
			if (num >= 0 && num <= 300)
			{
				result = "#*^";
			}
			if (num > 300 && num <= 600)
			{
				result = "^*#";
			}
			if (num > 600 && num <= 999)
			{
				result = "*#^";
			}
			break;
		case "4":
			num = DateTime.Now.Millisecond;
			if (num >= 0 && num <= 300)
			{
				result = "$@%";
			}
			if (num > 300 && num <= 600)
			{
				result = "@%$";
			}
			if (num > 600 && num <= 999)
			{
				result = "%$@";
			}
			break;
		case "5":
			num = DateTime.Now.Millisecond;
			if (num >= 0 && num <= 300)
			{
				result = "!*^";
			}
			if (num > 300 && num <= 600)
			{
				result = "^*!";
			}
			if (num > 600 && num <= 999)
			{
				result = "*^!";
			}
			break;
		case "6":
			num = DateTime.Now.Millisecond;
			if (num >= 0 && num <= 300)
			{
				result = "&*%";
			}
			if (num > 300 && num <= 600)
			{
				result = "*%&";
			}
			if (num > 600 && num <= 999)
			{
				result = "%*&";
			}
			break;
		case "7":
			num = DateTime.Now.Millisecond;
			if (num >= 0 && num <= 300)
			{
				result = "?^$";
			}
			if (num > 300 && num <= 600)
			{
				result = "$^?";
			}
			if (num > 600 && num <= 999)
			{
				result = "?$^";
			}
			break;
		case "8":
			num = DateTime.Now.Millisecond;
			if (num >= 0 && num <= 300)
			{
				result = "!?%";
			}
			if (num > 300 && num <= 600)
			{
				result = "?!%";
			}
			if (num > 600 && num <= 999)
			{
				result = "%?!";
			}
			break;
		case "9":
			num = DateTime.Now.Millisecond;
			if (num >= 0 && num <= 300)
			{
				result = "*^@";
			}
			if (num > 300 && num <= 600)
			{
				result = "^@*";
			}
			if (num > 600 && num <= 999)
			{
				result = "@^*";
			}
			break;
		case "-":
			num = DateTime.Now.Millisecond;
			if (num >= 0 && num <= 300)
			{
				result = "?#&";
			}
			if (num > 300 && num <= 600)
			{
				result = "#?&";
			}
			if (num > 600 && num <= 999)
			{
				result = "&?#";
			}
			break;
		case "/":
			num = DateTime.Now.Millisecond;
			if (num >= 0 && num <= 300)
			{
				result = "?*@";
			}
			if (num > 300 && num <= 600)
			{
				result = "*?@";
			}
			if (num > 600 && num <= 999)
			{
				result = "?@*";
			}
			break;
		case "a":
			result = "@";
			break;
		case "b":
			result = "#";
			break;
		case "c":
			result = "$";
			break;
		case "z":
			result = "%";
			break;
		case ".":
			num = DateTime.Now.Millisecond;
			if (num >= 0 && num <= 300)
			{
				result = "$@!";
			}
			if (num > 300 && num <= 600)
			{
				result = "!$@";
			}
			if (num > 600 && num <= 999)
			{
				result = "$!@";
			}
			break;
		}
		return result;
	}

	public static string RestoreChr(string Chr)
	{
		switch (Chr)
		{
		case "@#$":
		case "#$@":
		case "$#@":
			if (true)
			{
				return "0";
			}
			break;
		}
		switch (Chr)
		{
		case "%^&":
		case "^%&":
		case "&%^":
			if (true)
			{
				return "1";
			}
			break;
		}
		switch (Chr)
		{
		case "*!@":
		case "@!*":
		case "!*@":
			if (true)
			{
				return "2";
			}
			break;
		}
		switch (Chr)
		{
		case "#*^":
		case "^*#":
		case "*#^":
			if (true)
			{
				return "3";
			}
			break;
		}
		switch (Chr)
		{
		case "$@%":
		case "@%$":
		case "%$@":
			if (true)
			{
				return "4";
			}
			break;
		}
		switch (Chr)
		{
		case "!*^":
		case "^*!":
		case "*^!":
			if (true)
			{
				return "5";
			}
			break;
		}
		switch (Chr)
		{
		case "&*%":
		case "*%&":
		case "%*&":
			if (true)
			{
				return "6";
			}
			break;
		}
		switch (Chr)
		{
		case "?^$":
		case "$^?":
		case "?$^":
			if (true)
			{
				return "7";
			}
			break;
		}
		switch (Chr)
		{
		case "!?%":
		case "?!%":
		case "%?!":
			if (true)
			{
				return "8";
			}
			break;
		}
		switch (Chr)
		{
		case "*^@":
		case "^@*":
		case "@^*":
			if (true)
			{
				return "9";
			}
			break;
		}
		switch (Chr)
		{
		case "?#&":
		case "#?&":
		case "&?#":
			if (true)
			{
				return "-";
			}
			break;
		}
		switch (Chr)
		{
		case "?*@":
		case "*?@":
		case "?@*":
			if (true)
			{
				return "/";
			}
			break;
		}
		switch (Chr)
		{
		case "@":
			return "a";
		case "#":
			return "b";
		case "$":
			return "c";
		case "%":
			return "z";
		case "$@!":
		case "!$@":
		case "$!@":
			if (true)
			{
				return ".";
			}
			break;
		}
		string result = default(string);
		return result;
	}

	public static string CtoGB(string tempstr)
	{
		int num = Strings.Len(tempstr);
		int num2 = 1;
		checked
		{
			string text = default(string);
			while (true)
			{
				int num3 = num2;
				int num4 = num;
				if (num3 > num4)
				{
					break;
				}
				string @string = Strings.Left(tempstr, 1);
				tempstr = Strings.Right(tempstr, Strings.Len(tempstr) - 1);
				text = ((Operators.CompareString(Strings.Left(Conversion.Hex(Strings.Asc(@string)), 4), "FFFF", TextCompare: false) != 0) ? (text + Fill_Zero(Conversion.Hex(Strings.Asc(@string)))) : (text + Strings.Right(Conversion.Hex(Strings.Asc(@string)), 4)));
				num2++;
			}
			return text;
		}
	}

	public static string CtoGB_Num_ALL(string tempstr)
	{
		int num = Strings.Len(tempstr);
		int num2 = 1;
		checked
		{
			string text = default(string);
			while (true)
			{
				int num3 = num2;
				int num4 = num;
				if (num3 > num4)
				{
					break;
				}
				string @string = Strings.Left(tempstr, 1);
				tempstr = Strings.Right(tempstr, Strings.Len(tempstr) - 1);
				text = ((Operators.CompareString(Strings.Left(Conversion.Hex(Strings.Asc(@string)), 4), "FFFF", TextCompare: false) != 0) ? (text + Fill_Zero(Conversion.Hex((double)(Strings.Asc(@string) * 10) / 2.0))) : (text + Strings.Right(Conversion.Hex((double)(Strings.Asc(@string) * 10) / 2.0), 4)));
				num2++;
			}
			return text;
		}
	}

	public static string CtoGB_Num(string tempstr, string Type, DateTime TestDate)
	{
		tempstr = tempstr + Type + TestDate.ToString("yyyy-MM-dd");
		int num = Strings.Len(tempstr);
		int num2 = 1;
		string text = default(string);
		int millisecond;
		checked
		{
			while (true)
			{
				int num3 = num2;
				int num4 = num;
				if (num3 > num4)
				{
					break;
				}
				string chr = Strings.Left(tempstr, 1);
				tempstr = Strings.Right(tempstr, Strings.Len(tempstr) - 1);
				text += ChangeChr(chr);
				num2++;
			}
			millisecond = DateTime.Now.Millisecond;
		}
		string text2 = default(string);
		if (millisecond >= 0 && millisecond <= 100)
		{
			text2 = "0";
		}
		if (millisecond > 100 && millisecond <= 200)
		{
			text2 = "1";
		}
		if (millisecond > 200 && millisecond <= 300)
		{
			text2 = "2";
		}
		if (millisecond > 300 && millisecond <= 400)
		{
			text2 = "3";
		}
		if (millisecond > 400 && millisecond <= 500)
		{
			text2 = "4";
		}
		if (millisecond > 500 && millisecond <= 600)
		{
			text2 = "5";
		}
		if (millisecond > 600 && millisecond <= 700)
		{
			text2 = "6";
		}
		if (millisecond > 700 && millisecond <= 800)
		{
			text2 = "7";
		}
		if (millisecond > 800 && millisecond <= 900)
		{
			text2 = "8";
		}
		if (millisecond > 900 && millisecond <= 999)
		{
			text2 = "9";
		}
		string text3 = default(string);
		switch (text2)
		{
		case "0":
			millisecond = DateTime.Now.Millisecond;
			if (millisecond >= 0 && millisecond <= 300)
			{
				text3 = "";
			}
			if (millisecond > 300 && millisecond <= 600)
			{
				text3 = "";
			}
			if (millisecond > 500 && millisecond <= 999)
			{
				text3 = "";
			}
			break;
		case "1":
			millisecond = DateTime.Now.Millisecond;
			if (millisecond >= 0 && millisecond <= 300)
			{
				text3 = "@";
			}
			if (millisecond > 300 && millisecond <= 600)
			{
				text3 = "#";
			}
			if (millisecond > 500 && millisecond <= 999)
			{
				text3 = "$";
			}
			break;
		case "2":
			millisecond = DateTime.Now.Millisecond;
			if (millisecond >= 0 && millisecond <= 300)
			{
				text3 = "@#";
			}
			if (millisecond > 300 && millisecond <= 600)
			{
				text3 = "#@";
			}
			if (millisecond > 500 && millisecond <= 999)
			{
				text3 = "$#";
			}
			break;
		case "3":
			millisecond = DateTime.Now.Millisecond;
			if (millisecond >= 0 && millisecond <= 300)
			{
				text3 = "@#$";
			}
			if (millisecond > 300 && millisecond <= 600)
			{
				text3 = "#@$";
			}
			if (millisecond > 500 && millisecond <= 999)
			{
				text3 = "$#%";
			}
			break;
		case "4":
			millisecond = DateTime.Now.Millisecond;
			if (millisecond >= 0 && millisecond <= 300)
			{
				text3 = "*&^%";
			}
			if (millisecond > 300 && millisecond <= 600)
			{
				text3 = "@#$*";
			}
			if (millisecond > 500 && millisecond <= 999)
			{
				text3 = "%$^&";
			}
			break;
		case "5":
			millisecond = DateTime.Now.Millisecond;
			if (millisecond >= 0 && millisecond <= 300)
			{
				text3 = "!@#$%";
			}
			if (millisecond > 300 && millisecond <= 600)
			{
				text3 = "#!*&^";
			}
			if (millisecond > 500 && millisecond <= 999)
			{
				text3 = "%$@!&";
			}
			break;
		case "6":
			millisecond = DateTime.Now.Millisecond;
			if (millisecond >= 0 && millisecond <= 300)
			{
				text3 = "%$#@!*";
			}
			if (millisecond > 300 && millisecond <= 600)
			{
				text3 = "@!#$%^";
			}
			if (millisecond > 500 && millisecond <= 999)
			{
				text3 = "*&^%$@";
			}
			break;
		case "7":
			millisecond = DateTime.Now.Millisecond;
			if (millisecond >= 0 && millisecond <= 300)
			{
				text3 = "&*^%@#$";
			}
			if (millisecond > 300 && millisecond <= 600)
			{
				text3 = "*^&%#@!";
			}
			if (millisecond > 500 && millisecond <= 999)
			{
				text3 = "#@!$%^*";
			}
			break;
		case "8":
			millisecond = DateTime.Now.Millisecond;
			if (millisecond >= 0 && millisecond <= 300)
			{
				text3 = "&*^%$#@!";
			}
			if (millisecond > 300 && millisecond <= 600)
			{
				text3 = "^%&*$@!#";
			}
			if (millisecond > 500 && millisecond <= 999)
			{
				text3 = "%^*&@#$!";
			}
			break;
		case "9":
			millisecond = DateTime.Now.Millisecond;
			if (millisecond >= 0 && millisecond <= 300)
			{
				text3 = "!#@$@^&%*";
			}
			if (millisecond > 300 && millisecond <= 600)
			{
				text3 = "&^*%$%#@!";
			}
			if (millisecond > 500 && millisecond <= 999)
			{
				text3 = "#!@$@%^&*";
			}
			break;
		}
		return ChangeChr(text2) + text3 + text;
	}

	public static string GBtoC(string HexStr)
	{
		checked
		{
			int num = (int)Math.Round((double)Strings.Len(HexStr) / 4.0);
			int num2 = 1;
			string text2 = default(string);
			while (true)
			{
				int num3 = num2;
				int num4 = num;
				if (num3 > num4)
				{
					break;
				}
				string text = Strings.Left(HexStr, 4);
				HexStr = Strings.Right(HexStr, Strings.Len(HexStr) - 4);
				text2 += Conversions.ToString(Strings.Chr(Conversions.ToInteger("&H" + text)));
				num2++;
			}
			return text2;
		}
	}

	public static string GetEntrustUnitName(string MaskStr)
	{
		string text = "";
		string text2 = "";
		int num = 0;
		string result;
		try
		{
			text = GBtoC(MaskStr);
			num = text.IndexOf("★");
			text2 = Strings.Right(text, checked(text.Length - (num + 1)));
			num = text2.IndexOf("★");
			text2 = Strings.Left(text2, num);
			result = text2;
		}
		catch (Exception ex)
		{
			ProjectData.SetProjectError(ex);
			Exception ex2 = ex;
			result = "";
			ProjectData.ClearProjectError();
		}
		return result;
	}

	public static string GetProjectName(string MaskStr)
	{
		string text = "";
		string text2 = "";
		int num = 0;
		string result;
		try
		{
			text = GBtoC(MaskStr);
			num = text.IndexOf("★");
			text2 = Strings.Left(text, num);
			result = text2;
		}
		catch (Exception ex)
		{
			ProjectData.SetProjectError(ex);
			Exception ex2 = ex;
			result = "";
			ProjectData.ClearProjectError();
		}
		return result;
	}

	public static string GetBuildUnitName(string MaskStr)
	{
		string text = "";
		string text2 = "";
		int num = 0;
		checked
		{
			string result;
			try
			{
				text = GBtoC(MaskStr);
				num = text.IndexOf("★");
				text2 = Strings.Right(text, text.Length - (num + 1));
				num = text2.IndexOf("★");
				text2 = Strings.Right(text2, text2.Length - (num + 1));
				result = text2;
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				result = "";
				ProjectData.ClearProjectError();
			}
			return result;
		}
	}

	public static string GBtoC_Num(string HexStr, MaskType Mask)
	{
		string chr = Strings.Left(HexStr, 3);
		checked
		{
			HexStr = Strings.Right(HexStr, Strings.Len(HexStr) - 3);
			int num = Convert.ToInt32(RestoreChr(chr));
			HexStr = Strings.Right(HexStr, Strings.Len(HexStr) - num);
			int num2 = 1;
			int num3;
			int num4;
			string text = default(string);
			do
			{
				chr = Strings.Left(HexStr, 3);
				HexStr = Strings.Right(HexStr, Strings.Len(HexStr) - 3);
				text += RestoreChr(chr);
				num2++;
				num3 = num2;
				num4 = 10;
			}
			while (num3 <= num4);
			chr = Strings.Left(HexStr, 1);
			HexStr = Strings.Right(HexStr, Strings.Len(HexStr) - 1);
			text += RestoreChr(chr);
			int num5 = (int)Math.Round((double)Strings.Len(HexStr) / 3.0);
			num2 = 1;
			while (true)
			{
				int num6 = num2;
				num4 = num5;
				if (num6 > num4)
				{
					break;
				}
				chr = Strings.Left(HexStr, 3);
				HexStr = Strings.Right(HexStr, Strings.Len(HexStr) - 3);
				text += RestoreChr(chr);
				num2++;
			}
			switch (Mask)
			{
			case MaskType.All:
				text = text;
				break;
			case MaskType.Ypbh:
				text = Strings.Left(text, 10);
				text = text;
				break;
			case MaskType.Type:
				text = Strings.Right(Strings.Left(text, 11), 1);
				text = text;
				break;
			case MaskType.Time:
				text = Strings.Mid(text, 12);
				text = text;
				break;
			}
			return text;
		}
	}

	public static string Fill_Zero(string tempstr)
	{
		checked
		{
			short num = (short)(4 - Strings.Len(tempstr));
			short num2 = 1;
			while (true)
			{
				short num3 = num2;
				short num4 = num;
				if (num3 > num4)
				{
					break;
				}
				tempstr = "0" + tempstr;
				num2 = (short)unchecked(num2 + 1);
			}
			return tempstr;
		}
	}
}
